<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理员列表 - Powered By LIUSANY</title>
</head>
<body class="list">
	<div class="bar">
		权限列表&nbsp;总记录数: ${pager.totalItems} (共${pager.totalPages}页)
	</div>
	<div class="body">
		<form:form id="listForm" modelAttribute="page" action="${ctx}/admin/group/list" method="post">
		<div class="listBar">
           <input type="button" class="formButton" onclick="location.href='${ctx}/admin/group/create'" value="添加权限" hidefocus />
			&nbsp;&nbsp;
			
				<label>每页显示: </label>
				<select name="pageSize" id="pageSize">
					<option value="10" <c:if test="${pager.pageSize == 10 }">selected</c:if> >
						10
					</option>
					<option value="20" <c:if test="${pager.pageSize == 20 }">selected</c:if> >
						20
					</option>
					<option value="50" <c:if test="${pager.pageSize == 50 }">selected</c:if> >
						50
					</option>
				</select>
		</div>
			<table id="listTable" class="listTable">
				<tr>
					<th class="check">
						<input type="checkbox" class="allCheck" />
					</th>
					<th>
						<a href="#"  hidefocus>名称</a>
					</th>
					<th>
						<a href="#"  hidefocus>授权</a>
					</th>
					<th>
						<span>操作</span>
					</th>
				</tr>
				
				<c:forEach items="${pager.result}" var="group">
					<tr>
						<td>
							<input type="checkbox" name="ids" value="${group.id}" />
						</td>
						<td>
							${group.name}
						</td>
						<td>
							${group.permissionNames}
						</td>
						<td>
							<a href="${ctx }/admin/group/update/${group.id}" title="编辑">[编辑]</a>
						</td>
					</tr>
				</c:forEach>
				
			</table>
			<div class="pagerBar">
				<div class="delete">
					<input type="button" id="deleteButton" class="formButton" url="${ctx }/admin/group/delete" value="删 除" disabled hidefocus />
				</div>
				
				<div class="pager">
				<%@ include file="/WEB-INF/views/admin/pager.jsp"%>
			    </div>
	    </form:form>
	</div>
</body>
</html>